package com.lxu.service;

import org.jodconverter.DocumentConverter;
import org.jodconverter.document.DefaultDocumentFormatRegistry;
import org.jodconverter.office.OfficeException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.File;

@Service
public class ConvertService {

    @Autowired
    private DocumentConverter documentConverter;

	public void convert(File oldFile, File newFile) throws OfficeException {
        documentConverter
                .convert(oldFile)
                .to(newFile)
                .execute();

    }
}
